//package com.dw.listener;
//
//import com.dw.model.message.TestMessage;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.messaging.Message;
//
//import java.util.function.Consumer;
//
//@Configuration
//public class ListenerConfig {
//    @Bean
//    public Consumer<Message<TestMessage>> consumer(){
//        return msg ->{
//            System.out.println("收到消息ID:"+msg.getHeaders().get("messageId"));
//            System.out.println("订阅消息:"+msg.getPayload().getMsgId());
//            System.out.println("--------------------------------");
//
//        };
//    }
////
////    @Bean
////    public Consumer<Message<TestMessage>> productConsumer(){
////        return msg ->{
////            System.out.println("收到消息ID:"+msg.getHeaders().get("messageId"));
////            System.out.println("订阅消息:"+msg.getPayload().getMsgId());
////            System.out.println("--------------------------------");
////
////        };
////    }
//
//}
